package sk.tuke.constraintbuilder.model;

import java.util.HashSet;
import java.util.List;
import java.util.Set;

import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlRootElement;

@XmlRootElement(name = "ruleset", namespace="sk.tuke.constraintbuilder")
public class Ruleset extends RootElement{

	private Set<Constraint> constraints = new HashSet<Constraint>();
	
	public Ruleset(){
		super();
		super.setName("New Ruleset [id  "+super.getId()+"]");
	}

	@XmlElement(name = "constraint")
	public Set<Constraint> getConstraints() {
		return constraints;
	}

	
	public void addConstraint(Constraint constraint){
		this.constraints.add(constraint);
	}

	public void addConstraints(List<Constraint> constraints) {
		this.constraints.addAll(constraints);
	} 
	
	public void removeConstraint(Constraint constraint){
		this.constraints.remove(constraint);
	}
}
